//
//  GYLogger_Macros.h
//  GYLogger
//
//  Created by APPLE on 2020/6/24.
//  Copyright © 2020 APPLE. All rights reserved.
//

#ifndef GYLogger_Macros_h
#define GYLogger_Macros_h

#define GYLog(isAsynchronous,simpleFormat, lvl, flg, ctx, atag, fnct, frmt, ...) \
do {\
     GYLogger * logger = [GYLogger shareInstance];\
     logger.simpleFormate = simpleFormat;\
     LOG_MAYBE(isAsynchronous,logger.level,flg,ctx,atag,fnct,frmt,## __VA_ARGS__);\
 } while (0)\

#define GYLogVerbose(frmt,...) GYLog(LOG_ASYNC_ENABLED, YES, DDLogLevelVerbose, DDLogFlagVerbose, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)
#define GYLogVerboseDetailed(frmt,...) GYLog(LOG_ASYNC_ENABLED, NO, DDLogLevelVerbose, DDLogFlagVerbose, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)

#define GYLogDebug(frmt,...) GYLog(LOG_ASYNC_ENABLED, YES, DDLogLevelDebug, DDLogFlagDebug, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)
#define GYLogDebugDetailed(frmt,...) GYLog(LOG_ASYNC_ENABLED, NO, DDLogLevelDebug, DDLogFlagDebug, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)

#define GYLogInfo(frmt,...) GYLog(LOG_ASYNC_ENABLED, YES, DDLogLevelInfo, DDLogFlagInfo, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)
#define GYLogInfoDetailed(frmt,...) GYLog(LOG_ASYNC_ENABLED, NO, DDLogLevelInfo, DDLogFlagInfo, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)

#define GYLogWarnning(frmt,...) GYLog(LOG_ASYNC_ENABLED, YES, DDLogLevelWarning, DDLogFlagWarning, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)
#define GYLogWarnningDetailed(frmt,...) GYLog(LOG_ASYNC_ENABLED, NO, DDLogLevelWarning, DDLogFlagWarning, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)

#define GYLogError(frmt,...) GYLog(LOG_ASYNC_ENABLED, YES, DDLogLevelError, DDLogFlagError, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)
#define GYLogErrorDetailed(frmt,...) GYLog(LOG_ASYNC_ENABLED, NO, DDLogLevelError, DDLogFlagError, 0, nil, __FUNCTION__, frmt, ## __VA_ARGS__)


#endif /* GYLogger_Macros_h */
